m = eval(input())
n = eval(input())
print(m + n, end=' ')
print(m * n, end=' ')
print(m ** n, end=' ')
print(m % n, end=' ')
if m > n:
    print(m)
else:
    print(n)
